<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
<title>漂亮的响应式Bootstrap后台管理系统模板MatAdmin</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/bootstrap.min.css" />
<!-- <link rel="stylesheet" href="/phpwmscm/PUBLIC/css/bootstrap-responsive.min.css" /> -->
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/fullcalendar.css" />
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/matrix-style.css" />
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/matrix-media.css" />
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/index.css" />
<link href="/phpwmscm/PUBLIC/font-awesome/css/font-awesome.css" rel="stylesheet" />
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/jquery.gritter.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'>
<script src="/phpwmscm/PUBLIC/js/jquery-1.8.0.min.js"></script> 
    <style type="text/css">
		#allmap{width:100%;height:450px;}
	</style>
	<style>
        html, body, #container {
            height: 100%;
            width: 100%;
        }

        .amap-icon img,
        .amap-marker-content img{
            width: 25px;
            height: 34px;
        }

        .marker {
            position: absolute;
            top: -20px;
            right: -118px;
            color: #fff;
            padding: 4px 10px;
            box-shadow: 1px 1px 1px rgba(10, 10, 10, .2);
            white-space: nowrap;
            font-size: 12px;
            font-family: "";
            background-color: #25A5F7;
            border-radius: 3px;
        }

        .input-card{
            width: 18rem;
            z-index: 170;
        }

        .input-card .btn{
            margin-right: .8rem;
        }

        .input-card .btn:last-child{
            margin-right: 0;
        }
    </style>
   
<style>

.parent {
	display: block;
	height:0px;
    padding-bottom:100%
}

.parent {
	 writing-mode: horizontal-tb; 
}

.child {
	margin: 10px 10px 10px 10px;
	border: 5px solid black;
	padding: 5px;
	width: 450px;
	height: 750px;
	text-align: center;
	background: lightblue;
	writing-mode: horizontal-tb;
	display: inline-block;
}
</style>
<style>
#newwwf{position:relative;width:100%;height:1200px;border:2px solid #000;margin:10px auto;overflow:hidden;}
#allmap,#bottom{height:700px;overflow:hidden;}
#line{position:absolute;top:58%;width:100%;height:4px;overflow:hidden;margin-top:-2px;background:red;cursor:n-resize;}
</style>
<!-- <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=hNx4DUGHj4NRfZZIlfmSkkaxpwe1r8Zj"></script> -->
	  <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=9236cca4395c6f2a6e7dbd58677501c5"></script>   
</head>
<body>
        
<!--Header-part-->
<div id="header">
  <h1><a href="dashboard.html">MatAdmin</a></h1>
</div>
<!--close-Header-part-->
<!--top-Header-menu-->
<div id="user-nav" class="navbar navbar-inverse">
  <ul class="nav">
    <li  class="dropdown" id="profile-messages" ><a title="" href="#" data-toggle="dropdown" data-target="#profile-messages" class="dropdown-toggle"><i class="icon icon-user"></i>  <span id="userbeifn" class="text"><?php echo ($user); ?></span><b class="caret"></b></a>
      <ul class="dropdown-menu">
        <li><a href="#"><i class="icon-user"></i> 我的资料</a></li>
        <li class="divider"></li>
        <li><a href="#"><i class="icon-check"></i> 我的任务</a></li>
        <li class="divider"></li>
        <li><a href="<?php echo U('Login/logout');?>"><i class="icon-key"></i> 退出</a></li>
      </ul>
    </li>
    <li class="dropdown" id="menu-messages"><a href="#" data-toggle="dropdown" data-target="#menu-messages" class="dropdown-toggle"><i class="icon icon-envelope"></i> <span class="text">消息</span> <span class="label label-important">5</span> <b class="caret"></b></a>
      <ul class="dropdown-menu">
        <li><a class="sAdd" title="" href="#"><i class="icon-plus"></i> 新消息</a></li>
        <li class="divider"></li>
        <li><a class="sInbox" title="" href="#"><i class="icon-envelope"></i> 收件箱</a></li>
        <li class="divider"></li>
        <li><a class="sOutbox" title="" href="#"><i class="icon-arrow-up"></i> 发件箱</a></li>
        <li class="divider"></li>
        <li><a class="sTrash" title="" href="#"><i class="icon-trash"></i> 发送</a></li>
      </ul>
    </li>
    <li class=""><a title="" href="#"><i class="icon icon-cog"></i> <span class="text">设置</span></a></li>
    <li class=""><a title="" href="<?php echo U('Login/logout');?>"><i class="icon icon-share-alt"></i> <span class="text">退出</span></a></li>
  </ul>
</div>
<!--close-top-Header-menu-->
<!--start-top-serch-->
<div id="search">
  <input type="text" placeholder="输入搜索内容..."/>
  <button type="submit" class="tip-bottom" title="Search"><i class="icon-search icon-white"></i></button>
</div>
<!--close-top-serch-->
<div id="sidebar"><a href="#" class="visible-phone"><i class="icon-home"></i> 控制台</a>
  <ul>
    <!-- <li><a href="<?php echo U('Index/index');?>"><i class="icon-home"></i> <span>首页</span></a> </li>
    <li> <a href="<?php echo U('Log/index');?>"><i class="icon-signal"></i> <span>库存单品编码</span></a> </li>
    <li> <a href="<?php echo U('Lsdl/index');?>"><i class="icon-signal"></i> <span>客户门店添加</span></a> </li>
    <li class="active"> <a href="<?php echo U('Ls/index');?>"><i class="icon-signal"></i> <span>门店报单编辑</span></a> </li>
    <li> <a href="<?php echo U('Lsrb/index');?>"><i class="icon-signal"></i> <span>已报订单确认</span></a> </li>
    <li> <a href="<?php echo U('Nslsrb/index');?>"><i class="icon-signal"></i> <span>日报新增删除</span></a> </li>
    <li > <a href="<?php echo U('Sc/index');?>"><i class="icon-signal"></i> <span>商超批量派车</span></a> </li>
    <li> <a href="<?php echo U('Scdl/index');?>"><i class="icon-signal"></i> <span>商超独立派车</span></a> </li>
    <li> <a href="<?php echo U('Wpcmd/index');?>"><i class="icon-signal"></i> <span>未派订单处理</span></a> </li>    -->
  </ul>
</div>
<!--sidebar-menu-->

<!--main-container-part-->
<div id="content">
<!--breadcrumbs-->
  <div id="content-header">
    <div id="f"> <a href="index.html" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> 首页</a></div>
  </div>
<!-- End-breadcrumbs -->

<!-- Action boxes -->

  <div id="" class="" >
    <div id=""></div> 
    <div id=""> 
    <div> 
    <!-- <form action="<?php echo U('ls/upfile');?>" enctype="multipart/form-data" method="post">
	 <input type="file" name="photo" /> <input type="submit" value="提交">
    </form> -->
    <!-- <button id="fbt6">加载配送信息</button>
    <button id="fbt1">追加</button>
	<button id="fbt2">删除</button>
	<button id="fbt3">保存</button>
	<button id="fbt4">预览</button>
	<button id="fbt5">提交</button>
	<button id="fbt7">提交并保存</button>
	<button id="fbt8">删除缓存</button>
	<button id="fbt9">无订单加载缓存</button>
    <datalist id="typelist"> 
    </datalist>-->
    <datalist id="typelist"> 
    </datalist>
              库存截止日期开始:<input type=date id="dbb1" >         
              单品<input type=text list="listItem"  placeholder="请选择单品"  id="dbb3" value="全部" > 
    <datalist  id="listItem">
			  <option>全部</option>						     
	</datalist>   
	货物类型<select id="dbb4">	
					<option>全部</option>									
					<option>冻货</option>
					<option>鲜货</option>	
					<option>干货</option>										
		 </select>	       
	<button id="fbt444">查询单品加批次库存数据</button>	
	<button id="fbt666">查询单品库存数据</button>
	<button id="fbt555">导出数据</button>		
	</div>   
	    
	<div  class="parent pre-scrollable" ><!-- 与wwf分离，来保存input变量  class="parent pre-scrollable" -->   
    <div  id="wwf"> 
                            <table id=tablea class="table table-bordered table-striped" >							
							<thead>
							<tr>							 
							    <th><nobr>序号</nobr></th>
							  
							    <th style="color:#f0f"><nobr>品名</nobr></th>
							    <th style="color:#f0f"><nobr>单品批次</nobr></th>
							    <th id="jsjs" style="color:#21f"><nobr>入库件数</nobr></th>	
							    <th style="color:#21f"><nobr>真实出库件数</nobr></th>	
							    <th style="color:#21f"><nobr>真实库存数</nobr></th>
							    <th style="color:#f0f"><nobr>虚拟出库件数</nobr></th>
                                <th style="color:#f0f"><nobr>虚拟库存数</nobr></th>		
							    <th style="color:#000"><nobr>库存状态</nobr></th>	
							    <th><nobr>商品编码</nobr></th>
							    <th><nobr>商品条码</nobr></th>
							    <th><nobr>单品规格</nobr></th>
							    <th style="color:#f0f"><nobr>箱规</nobr></th>
							    <th><nobr>货物类型</nobr></th>
							    <th><nobr>保质期</nobr></th>		
							    <th><nobr>库位合并</nobr></th>	
							    <th><nobr>是否禁止发货</nobr></th>	
							    <th><nobr>禁止发货单品的入库日期</nobr></th>
							    <th style="color:#f0f"><nobr>入库重量</nobr></th>
							    <th style="color:#f0f"><nobr>出库重量</nobr></th>	
							    <th style="color:#f0f"><nobr>结存重量</nobr></th>							  
							  							    		    						 
							</tr>
							</thead>
							<tbody class="pre-scrollable">							
							</tbody>							
						</table>     
	</div>    
	</div>
	</div>
	<div id=""></div>
  </div>
<!-- End-Action boxes -->    

</div>

<!--end-main-container-part-->

<!--Footer-part-->

<div class="row-fluid">
  <div id="footer" class="span12">Copyright &copy; 2018.Company name All rights reserved.<a target="_blank" href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a> </div>
</div>


<script src="/phpwmscm/PUBLIC/js/excanvas.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.ui.custom.js"></script> 
<script src="/phpwmscm/PUBLIC/js/bootstrap.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.flot.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.flot.resize.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.peity.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/fullcalendar.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.dashboard.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.gritter.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.interface.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.chat.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.validate.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.form_validation.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.wizard.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.uniform.js"></script> 
<script src="/phpwmscm/PUBLIC/js/select2.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.popover.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.dataTables.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.tables.js"></script> 
<script src="/phpwmscm/PUBLIC/js/mindmup-editabletable.js"></script> 
<script src="/phpwmscm/PUBLIC/js/numeric-input-example.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.mousewheel.js"></script>
<!--end-Footer-part-->
<script type="text/javascript">


//ajax 测试
$.post("/phpwmscm/admin.php/Admin/Kcgl/ceshi/",
		    {
		    
		    },
		    function(data,status){	
		    	switch (data) 
		    	{		    	
		        case "1":
		    	{
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Index/index');?>'><i class='icon-home'></i> <span>首页</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Log/index');?>'><i class='icon-signal'></i> <span>库存单品编码</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Lsdl/index');?>'><i class='icon-signal'></i> <span>客户门店添加</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Ls/index');?>'><i class='icon-signal'></i> <span>门店报单编辑</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Lsrb/index');?>'><i class='icon-signal'></i> <span>已报订单确认</span></a> </li>"); 	
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Dddy/index');?>'><i class='icon-signal'></i> <span>订单打印处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Rkcl/index');?>'><i class='icon-signal'></i> <span>单品入库处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Ddgz/index');?>'><i class='icon-signal'></i> <span>订单出库处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li class='active'> <a href='<?php echo U('Kcgl/index');?>'><i class='icon-signal'></i> <span>库存数据查看</span></a> </li>");
		        	
		        	break;
		    	}
		    	
		        case "2":
		    	{
		        	$('#sidebar').children("ul").append("<li><a href='<?php echo U('Index/index');?>'><i class='icon-home'></i> <span>首页</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Log/index');?>'><i class='icon-signal'></i> <span>库存单品编码</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Lsdl/index');?>'><i class='icon-signal'></i> <span>客户门店添加</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Ls/index');?>'><i class='icon-signal'></i> <span>门店报单编辑</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Lsrb/index');?>'><i class='icon-signal'></i> <span>已报订单确认</span></a> </li>"); 
		        	$('#sidebar').children("ul").append("<li class='active'> <a href='<?php echo U('Kcgl/index');?>'><i class='icon-signal'></i> <span>库存数据查看</span></a> </li>"); 
		        break;
		    	}
		    	
		        case "3":
		    	{ 
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Index/index');?>'><i class='icon-home'></i> <span>首页</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Log/index');?>'><i class='icon-signal'></i> <span>库存单品编码</span></a> </li>");	   	
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Dddy/index');?>'><i class='icon-signal'></i> <span>订单打印处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Rkcl/index');?>'><i class='icon-signal'></i> <span>单品入库处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Ddgz/index');?>'><i class='icon-signal'></i> <span>订单出库处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li class='active'> <a href='<?php echo U('Kcgl/index');?>'><i class='icon-signal'></i> <span>库存数据查看</span></a> </li>");
		        break;
		    	}
		    	
		        case "4":
		        {    	    	
		        	
		        break;
		        } 
		        
		        default: 
		        {
		    	break;
		        }
		        
		    	} 
		    	//$("#sidebar").find("li")[0].remove();    
		    });
/////////////////////////////////////////////////////////////////////////////////////////////////
//取回单品信息 $sjkTemp [$ii] [dpbzq].",";
	$.post("/phpwmscm/admin.php/Admin/Kcgl/ajaxdpbm1/", {

	}, function(data, status) {
					
		dinputlist = data.split(',');//转换为数组		
		$('#listItem').append('<option value=""></option>');//先加个空白值。
   	         for (var ig = 0; ig < dinputlist.length; ig=ig+1) 
   		{  	    		    
   			$('#listItem').append('<option value="' + dinputlist[ig] + '"></option>');
   		}   
	});
////////////////////////////////////////////////////////////////////////////////////////////////
//默认打开网页后显示单品+批次 库存表
$.post("/phpwmscm/admin.php/Admin/Kcgl/ajaxdppccx/", {

	}, function(data, status) {
		//console.log(data);
		var j1=$.parseJSON(data);	
		console.log(j1);
		var xuhao=1;
		var js1=0;
		var js2=0;
		var js3=0;
		var js4=0;
		var js5=0;
		var js6=0;
		var js7=0;
		
		var js8=0;
		for(var i=0;i<j1.length;i++){					
		 $('#tablea').children('tbody').append(
				    '<tr>'
				    +'<th>'+xuhao+'</th>'
				    +'<th>'+j1[i].pinming+'</th>'
				    +'<th>'+j1[i].pici+'</th>'
				    +'<th>'+j1[i].rksl+'</th>'
				    +'<th>'+j1[i].gzsm+'</th>'
				    +'<th style=color:#21f>'+j1[i].zskc+'</th>'
				    +'<th>'+j1[i].xnsm+'</th>'
				    +'<th style=color:#f0f>'+j1[i].xnkc+'</th>'
				    +'<th>0</th>'
				    +'<th>'+j1[i].hpbm+'</th>'
				    +'<th>'+j1[i].sptm+'</th>'
				    +'<th>'+j1[i].dpgg+'</th>'
				    +'<th>'+j1[i].djzlkg+'</th>'
				    +'<th>'+j1[i].hwlx+'</th>'
				    +'<th>'+j1[i].dpbzq+'</th>'
				    +'<th>'+j1[i].kwhb+'</th>'
		            +'<th>'+j1[i].jzfhbj+'</th>'
		            +'<th>'+j1[i].jzrkrq+'</th>'
		         
		            +'<th>'+j1[i].rkdpzl+'</th>'
		            +'<th>'+j1[i].ckdpzl+'</th>'
		            +'<th>'+j1[i].kcdpzl+'</th>'
		            +'</tr>'
		            );
		     xuhao=xuhao+1;
			 js1=js1+Number(j1[i].rksl);
			 js2=js2+Number(j1[i].gzsm);
			 js3=js3+Number(j1[i].zskc);
			 js4=js4+Number(j1[i].xnsm);
			 js5=js5+Number(j1[i].xnkc);
			 js6=js6+Number(j1[i].rkdpzl);
			 js7=js7+Number(j1[i].ckdpzl);
			 js8=js8+Number(j1[i].kcdpzl);
		}
		 $('#tablea').children('tbody').append(
				    '<tr>'
				    +'<th>0</th>'
				    +'<th>合计</th>'
				    +'<th>0</th>'
				    +'<th>'+js1+'</th>'
				    +'<th>'+js2+'</th>'
				    +'<th>'+js3+'</th>'
				    +'<th>'+js4+'</th>'
				    +'<th>'+js5+'</th>'
				    +'<th>0</th>'
				    +'<th>0</th>'
				    +'<th>0</th>'
				    +'<th>0</th>'
				    +'<th>0</th>'
				    +'<th></th>'
				    +'<th>0</th>'
		            +'<th>0</th>'
		            +'<th>0</th>'
		            +'<th>0</th>'
		            +'<th>'+js6+'</th>'
				    +'<th>'+js7+'</th>'
				    +'<th>'+js8+'</th>'
		            +'</tr>'
		            );
	});

////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//today保存当前日期，作为所有需要赋值date的值
////////////////////////////////////////////////////////////////////////
//取得日期
	function getDate(d1) {

		/* var	d2=Number(d1);//转换为数值。
		var time = new Date();
		var day = ("0" + (time.getDate()+d2)).slice(-2);
		
		var month = ("0" + (time.getMonth() + 1)).slice(-2);
		var today = time.getFullYear() + "-" + (month) + "-" + (day);
		
		return today; */
		var d2 = Number(d1);//转换为数值。
		var time = new Date();
		var n = time.getTime();
		//有多少天的间隔就加上相对应的秒数。
		//console.log(n); 
		n = n + d2 * 24 * 60 * 60 * 1000  ;
		//console.log(n); 

		var dd = new Date(+n+8*3600*1000);
		var today = dd.toISOString();
		return today.slice(0, 10);
		//console.log(n1.slice(0,10)); 
	}
	$('#dbb1').val(getDate(0));
	
////////////////////////////////////////////////////////////////////////
//清空工作区
	$('#fbt555').click(function(){
		alert("555");
		/* //清空工作区
		 $('#tablea').children('tbody').find("tr").each(function(){ 			   		
			 $(this).empty();		   
		   }); */		
	 });
////////////////////////////////////////////////////////////////////////
//入库数据查询
//工作区有数据不可新增 标记
var cxbj=0;
$('#fbt444').click(function(){
	 $('#tablea').children('tbody').empty();//删除datalist的所有子元素。
	$.post("/phpwmscm/admin.php/Admin/Kcgl/ajaxdppccxarq/", {
		arr1:$('#dbb1').val(),
		arr2:$('#dbb3').val(),
		arr3:$('#dbb4').val(),

	}, function(data, status) {
		
		var j1=$.parseJSON(data);	
		console.log(j1);
		var xuhao=1;
		var js1=0;
		var js2=0;
		var js3=0;
		var js4=0;
		var js5=0;
		var js6=0;
		var js7=0;
		
		var js8=0;
		for(var i=0;i<j1.length;i++){					
		 $('#tablea').children('tbody').append(
				    '<tr>'
				    +'<th>'+xuhao+'</th>'
				    +'<th>'+j1[i].pinming+'</th>'
				    +'<th>'+j1[i].pici+'</th>'
				    +'<th>'+j1[i].rksl+'</th>'
				    +'<th>'+j1[i].gzsm+'</th>'
				    +'<th style=color:#21f>'+j1[i].zskc+'</th>'
				    +'<th>'+j1[i].xnsm+'</th>'
				    +'<th style=color:#f0f>'+j1[i].xnkc+'</th>'
				    +'<th>0</th>'
				    +'<th>'+j1[i].hpbm+'</th>'
				    +'<th>'+j1[i].sptm+'</th>'
				    +'<th>'+j1[i].dpgg+'</th>'
				    +'<th>'+j1[i].djzlkg+'</th>'
				    +'<th>'+j1[i].hwlx+'</th>'
				    +'<th>'+j1[i].dpbzq+'</th>'
				    +'<th>'+j1[i].kwhb+'</th>'
		            +'<th>'+j1[i].jzfhbj+'</th>'
		            +'<th>'+j1[i].jzrkrq+'</th>'
		            +'<th>'+j1[i].rkdpzl+'</th>'
		            +'<th>'+j1[i].ckdpzl+'</th>'
		            +'<th>'+j1[i].kcdpzl+'</th>'
		            +'</tr>'
		            );
		     xuhao=xuhao+1;
			 js1=js1+Number(j1[i].rksl);
			 js2=js2+Number(j1[i].gzsm);
			 js3=js3+Number(j1[i].zskc);
			 js4=js4+Number(j1[i].xnsm);
			 js5=js5+Number(j1[i].xnkc);
			 js6=js6+Number(j1[i].rkdpzl);
			 js7=js7+Number(j1[i].ckdpzl);
			 js8=js8+Number(j1[i].kcdpzl);
		}
		 $('#tablea').children('tbody').append(
				    '<tr>'
				    +'<th>0</th>'
				    +'<th>合计</th>'
				    +'<th>0</th>'
				    +'<th>'+js1+'</th>'
				    +'<th>'+js2+'</th>'
				    +'<th>'+js3+'</th>'
				    +'<th>'+js4+'</th>'
				    +'<th>'+js5+'</th>'
				    +'<th>0</th>'
				    +'<th>0</th>'
				    +'<th>0</th>'
				    +'<th>0</th>'
				    +'<th>0</th>'
				    +'<th></th>'
				    +'<th>0</th>'
		            +'<th>0</th>'
		            +'<th>0</th>'
		            +'<th>0</th>'
		            +'<th>'+js6+'</th>'
				    +'<th>'+js7+'</th>'
				    +'<th>'+js8+'</th>'
		            +'</tr>'
		            );
	}); 

});
$('#fbt666').click(function(){
	 $('#tablea').children('tbody').empty();//删除datalist的所有子元素。
		$.post("/phpwmscm/admin.php/Admin/Kcgl/ajaxdppccxarqdp/", {
			arr1:$('#dbb1').val(),
			arr2:$('#dbb3').val(),
			arr3:$('#dbb4').val(),

		}, function(data, status) {
			//console.log(data);
			 var j1=$.parseJSON(data);	
			//console.log(j1);
			var xuhao=1;
			var js1=0;
			var js2=0;
			var js3=0;
			var js4=0;
			var js5=0;
			var js6=0;
			var js7=0;
			
			var js8=0;
			for(var i=0;i<j1.length;i++){					
			 $('#tablea').children('tbody').append(
					    '<tr>'
					    +'<th>'+xuhao+'</th>'
					    +'<th>'+j1[i].pinming+'</th>'
					    +'<th>'+j1[i].pici+'</th>'
					    +'<th>'+j1[i].rksl+'</th>'
					    +'<th>'+j1[i].gzsm+'</th>'
					    +'<th style=color:#21f>'+j1[i].zskc+'</th>'
					    +'<th>'+j1[i].xnsm+'</th>'
					    +'<th style=color:#f0f>'+j1[i].xnkc+'</th>'
					    +'<th>0</th>'
					    +'<th>'+j1[i].hpbm+'</th>'
					    +'<th>'+j1[i].sptm+'</th>'
					    +'<th>'+j1[i].dpgg+'</th>'
					    +'<th>'+j1[i].djzlkg+'</th>'
					    +'<th>'+j1[i].hwlx+'</th>'
					    +'<th>'+j1[i].dpbzq+'</th>'
					    +'<th>'+j1[i].kwhb+'</th>'
			            +'<th>0</th>'
			            +'<th>0</th>'
			            +'<th>'+j1[i].rkdpzl+'</th>'
			            +'<th>'+j1[i].ckdpzl+'</th>'
			            +'<th>'+j1[i].kcdpzl+'</th>'
			            +'</tr>'
			            );
			     xuhao=xuhao+1;
				 js1=js1+Number(j1[i].rksl);
				 js2=js2+Number(j1[i].gzsm);
				 js3=js3+Number(j1[i].zskc);
				 js4=js4+Number(j1[i].xnsm);
				 js5=js5+Number(j1[i].xnkc);
				 js6=js6+Number(j1[i].rkdpzl);
				 js7=js7+Number(j1[i].ckdpzl);
				 js8=js8+Number(j1[i].kcdpzl);
			}
			 $('#tablea').children('tbody').append(
					    '<tr>'
					    +'<th>0</th>'
					    +'<th>合计</th>'
					    +'<th>0</th>'
					    +'<th>'+js1+'</th>'
					    +'<th>'+js2+'</th>'
					    +'<th>'+js3+'</th>'
					    +'<th>'+js4+'</th>'
					    +'<th>'+js5+'</th>'
					    +'<th>0</th>'
					    +'<th>0</th>'
					    +'<th>0</th>'
					    +'<th>0</th>'
					    +'<th>0</th>'
					    +'<th></th>'
					    +'<th>0</th>'
			            +'<th>0</th>'
			            +'<th>0</th>'
			            +'<th>0</th>'
			            +'<th>'+js6+'</th>'
					    +'<th>'+js7+'</th>'
					    +'<th>'+js8+'</th>'
			            +'</tr>'
			            ); 
		}); 
});
var act;//这个变量在js中赋值，保存当前表格td焦点。  
   

	

</script>
</body>
</html>